package kr.ac.mlb.action;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import kr.ac.mlb.dao.ListDao;
import kr.ac.mlb.mvc.Action;
import kr.ac.mlb.mvc.HttpUtil;
import kr.ac.mlb.vo.ContentVo;

public class MainAction extends Action {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		// TODO Auto-generated method stub

		//리스트가져오기
		ListDao dao = new ListDao();
		List<ContentVo> list = dao.getList();
		
		//리쿼스트에 list 객체 저장
		request.setAttribute("list", list);

		HttpUtil.forward(request, response, "/views/main.jsp");
	}

}
